package JVM.chapter02.classLoader;

import java.io.FileNotFoundException;
import java.net.URLClassLoader;

public class ClassLoaderTest extends ClassLoader{


    @Override
    protected Class<?> findClass(String name) {
        byte[] result = getClassFromCustomPath(name);
        if(result == null){
            try {
                throw new FileNotFoundException();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }
        return defineClass(name,result,0, result.length);
    }

    private byte[] getClassFromCustomPath(String name){
        /**
         * todo 1. 从自定义文件中指定类：细节略。
         *       2.如果指定路径的字节码进行加密
         */
        return null;
    }


}
